from selenium.webdriver.common.by import By

class AdminMyResourceLocator:
    # 进入My Resource菜单
    my_resource_menu = (By.XPATH, '(//div[contains(@class,"cre-menu-layer-2")])[17]')
    # 进入My Resource2菜单
    my_resource_menu2 = (By.XPATH, '//*[text()="My Resource" and @class="cre-menu-layer-2"]')
    # 搜索条件选择框按钮
    #search_select_botton = (By.XPATH, '(//div[contains(@class,"antd4-select-selector")])[1]')
    search_select_botton = (By.XPATH, '//*[contains(@class,"antd4-select-in-form-item")]')
    # 下拉框选择product name
    # search_product_name = (By.XPATH, '(//div[contains(@class,"antd4-select-item antd4-select-item-option")])[3]')
    search_product_name = (By.XPATH, '//*[@title="Product Name"]')
    #ID
    #search_id = (By.XPATH, '(//div[contains(@class,"antd4-select-item antd4-select-item-option")])[2]')
    search_id = (By.XPATH, '//*[text()="Instance ID" and @class="antd4-select-item-option-content"]')

    #Organization
    search_organization = (By.XPATH, '(//div[contains(@class,"antd4-select-item antd4-select-item-option")])[4]')

    # product name输入框
    product_name_input = (By.ID, 'offerId')
    # product name输入框下拉第一个结果
    search_result = (By.XPATH, '(//div[contains(@class,"antd4-select-item antd4-select-item-option antd4-select-item-option-active")])[2]')
    # instance id 输入框
    instance_id_input= (By.XPATH, "//input[contains(@placeholder,'Search by instance ID')]")
    # email输入框
    email_input = (By.XPATH, "//input[contains(@placeholder,'Search by account email')]")
    # organization输入框
    organization_input = (By.ID, 'orgCode')
    #organization下拉第一个选择
    search_result1 = (By.XPATH, "(//div[contains(@class,'antd4-select-item-option-content')])[5]")
    # search按钮
    #search_botton = (By.XPATH, '//span[text() = "Search"]')
    search_botton = (By.XPATH, '//*[@class="anticon anticon-search"]/..')
    # My Resource search按钮
    my_resource_search_botton = (By.XPATH, '//span[text() = "Search"]/..')
    # product name第一个查询结果
    first_search_result = (By.XPATH, '(//div[contains(@style,"white-space")])[1]')


    # 当前展示月份选择start time和end time
    start_time_select = (By.XPATH, "//input[contains(@placeholder,'Start date')]")
    end_time_select = (By.XPATH, "//input[contains(@placeholder,'End date')]")

    #第一个结果email
    first_search_result1 = (By.XPATH, "(//div[contains(@class,'cre-table-nowrap')])[10]")
    #第一个结果email-expired time
    first_search_result2 = (By.XPATH, "(//div[contains(@class,'cre-table-nowrap')])[5]")

    #第一个结果instance id
    first_search_result3 = (By.XPATH, "(//div[contains(@class,'cre-table-nowrap')])[1]")
    #第一个结果instance id-expired time
    first_search_result4 = (By.XPATH, "(//div[contains(@class,'cre-table-nowrap antd4-tooltip-open')])[1]")

    # 第一个结果organization
    first_search_result5 = (By.XPATH, "(//div[contains(@class,'cre-table-nowrap')])[9]")
    # 第一个结果oraanization-expired time
    first_search_result6 = (By.XPATH, "(//div[contains(@class,'cre-table-nowrap')])[4]")

    # 列表字段
    Instance_ID = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[1]')
    Product_Name = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[2]')
    Region = (By.XPATH, '(//span[contains(@class,"antd4-table-column-title")])[1]')
    Billing_Method = (By.XPATH, '(//span[contains(@class,"antd4-table-column-title")])[2]')
    Created_Time = (By.XPATH, '(//span[contains(@class,"antd4-table-column-title")])[3]')
    Expired_Time = (By.XPATH, '(//span[contains(@class,"antd4-table-column-title")])[4]')
    Product_Type1 = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[7]//span[@class="antd4-table-column-title"]')
    Product_Type2 = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[8]')
    Enable_Auto_renewal = (By.XPATH, '(//div[contains(@class,"helpWrap")])[1]')
    Renewal_Status = (By.XPATH, '(//div[contains(@class,"helpWrap")])[2]')
    Auto_Scaling = (By.XPATH, '(//div[contains(@class,"helpWrap")])[3]')
    Oraganization = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[12]')
    Account_Email = (By.XPATH, '(//th[contains(@class,"antd4-table-cell")])[13]')

    #当前列表第一行
    list_first_line = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]')
    #created time列
    create_time = (By.CSS_SELECTOR, '[class="antd4-table-row antd4-table-row-level-0"]>:nth-child(5)>div')
    #第四页按钮
    four_pages_button = (By.XPATH, '(//li[contains(@class,"antd4-pagination-item antd4-pagination-item-4")])[1]')
    # created time排序按钮
    create_time_button = (By.XPATH, '(//div[contains(@class,"antd4-table-column-sorters")])[1]')


    # reset按钮
    reset_button = (By.XPATH, '//span[text() = "Reset"]')

    # release按钮
    release_button = (By.XPATH, '(//button[contains(@class,"antd4-btn antd4-btn-link")])[1]')

    # release界面Note提示语
    release_page_note = (By.XPATH, '(//div[contains(@class,"warning___2eFvi")])[1]')

    # release成功后Check Order按钮
    check_order_button = (By.XPATH, '//span[text() = "Check Order"]')

    #orders界面标题
    orders_page_title = (By.XPATH, '(//div[contains(@class,"antd4-space-item")])[1]')

    # my notification界面第一列标题
    notification_content = (By.XPATH, '(//div[contains(@class,"overflow___1Do5N")])[1]')

    #orders界面order type第一列
    order_type = (By.XPATH, '(//div[contains(@class,"cre-table-nowrap")])[3]')

    #orders查看详情按钮
    orders_view_detail_button = (By.XPATH, '(//td[contains(@class,"antd4-table-cell antd4-table-cell-fix-right antd4-table-cell-fix-right-first")])[2]')

    # my notification菜单
    my_notification_menu = (By.XPATH, '(//span[contains(@class,"main-item-dot")])[25]')













